package lambda;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * @Author: admin
 * @Description:
 * @Date: 2019/6/11 10:24
 */

public class MainTest {

    public static void test(InnerClass innerClass){

        Stream.iterate(0,a->a+2).limit(10).forEach(a-> System.out.println(a));
        //Stream.generate(a)


        List<String> strings= Arrays.asList("123", "345");
        strings.stream().map(s->s.split("")).flatMap(Arrays::stream) .distinct().forEach(System.out::println);

        strings.stream().peek(s-> System.out.println("asd"+s)).forEach(s-> System.out.println(s));
        System.out.println( Stream.of(12, 122).reduce(1,(s1, s2)->s1+s2));
        //String s= innerClass.process("123");
        //System.out.println(s);
    }


    public interface InnerClass{
        String process(String value);
    }

    public static void main(String[] args) {
         test(a->a.substring(1));
    }

}
